## 双指针，right套left
num,cash=[int(i) for i in input().split()]

prices=[int(i) for i in input().split()]
plan=[]
ans=0
for i in range(num):
    spend=0
    for j in range(i,num):
        spend+=prices[j]
        if spend<=cash:
            plan.append(prices[i:j+1]) ##切片是可以切过界的，不然最后一个元素切不到自己
            ans+=1
        else:
            break
    
print(ans)